Skip to content

feat(external-call): prepared-transaction codec for recorded results - #21

Draft
angelol wants to merge 5 commits into
angelol/external-call-06-split-pr1-foundationfrom
angelol/external-call-06-split-pr2-codec
Draft

feat(external-call): prepared-transaction codec for recorded results#21
angelol wants to merge 5 commits into
angelol/external-call-06-split-pr1-foundationfrom
angelol/external-call-06-split-pr2-codec

Conversation

@angelol

@angelol angelol commented Jun 30, 2026

Copy link
Copy Markdown

Review-only — do not merge. This is the clean per-PR diff for upstream review, stacked on angelol/external-call-06-split-pr1-foundation (PR 1). The mergeable upstream PR (targets main) opens after digital-asset#537 lands. Part of the 8-PR split that supersedes digital-asset#541.

Summary

This is PR 2 of 8 in the external-call runtime-integration series tracked in digital-asset#513, stacked on PR 1.

The external-call stack (digital-asset#513): digital-asset#506 added the transaction-side representation for recording external-call results; digital-asset#514 added the LF EXTERNAL_CALL builtin surface; digital-asset#518 wired it into Speedy and the LF engine; digital-asset#522 added transaction protobuf encoding/decoding; digital-asset#526 added Canton protocol serialization for recorded results; digital-asset#537 added the participant-side extension-service client. digital-asset#541 implemented the remaining runtime integration as one PR; this series splits digital-asset#541 into 8 independently reviewable PRs (each < 1000 lines) and supersedes it.

This PR adds the interactive-submission representation and codec for recorded external-call results, so prepared transactions can round-trip them.

Scope

This PR adds:

  • the ExternalCallResult interactive-submission message (interactive_submission_data.proto) and the related service doc-comments (interactive_submission_service.proto)
  • prepared-transaction encoding/decoding of recorded external-call results (PreparedTransactionEncoder / PreparedTransactionDecoder)
  • the regenerated protobuf snapshot, proto-data.yml and openapi.yaml for the new message
  • prepared-transaction codec tests

Out of scope

Runtime dispatch of external-call questions (PR 3+), engine replay (PR 4), and validation (PR 6–8).

Hashing Boundary

Prepared/external-submission signatures authorize the LF action. Recorded external-call result payloads are Canton protocol data protected by the Canton view signature (see PR 1). Prepared transactions therefore carry external-call results for round-tripping, but those result payloads are intentionally excluded from the LF/prepared node hash.

Refs digital-asset#513.

@angelol
angelol force-pushed the angelol/external-call-06-split-pr2-codec branch from 82997b5 to bfd7a14 Compare June 30, 2026 12:19
@angelol
angelol force-pushed the angelol/external-call-06-split-pr1-foundation branch from 8255166 to b62f4f6 Compare June 30, 2026 12:19
@angelol
angelol force-pushed the angelol/external-call-06-split-pr2-codec branch 2 times, most recently from 1db3847 to c88e6cf Compare June 30, 2026 16:31
canton-machine and others added 2 commits July 1, 2026 08:51
…l-asset#549)

## Summary

This is PR 1 of 8 in the external-call runtime-integration series tracked in digital-asset#513, building on digital-asset#537 (now merged to `main`).

The external-call stack (digital-asset#513): digital-asset#506 added the transaction-side representation for recording external-call results; digital-asset#514 added the LF `EXTERNAL_CALL` builtin surface; digital-asset#518 wired it into Speedy and the LF engine; digital-asset#522 added transaction protobuf encoding/decoding; digital-asset#526 added Canton protocol serialization for recorded results; digital-asset#537 added the participant-side extension-service client. digital-asset#541 implemented the remaining runtime integration as one PR; this series splits digital-asset#541 into 8 independently reviewable PRs (each < 1000 lines) and supersedes it.

This PR lays the protocol and transaction-hash foundation the rest of the series builds on: the Canton protocol fields that carry recorded external-call results, and the `HashingSchemeVersion` V4 hashing that covers them.

## Scope

This PR adds:

- `ViewParticipantData.externalCallResults` and the supporting protocol additions (`participant_transaction.proto`, `SubmitterMetadata`, `ExternalAuthorization`, `LocalRejectError`), including the `ImmArray → Seq` migration of the recorded-results collection across the base/common/participant transaction-tree construction sites
- `HashingSchemeVersion` V4 (dev-gated) and the v4 node/transaction hashers that fold recorded external-call result payloads into the transaction hash, with the payloads surfaced in the `HashTracer` output
- the `HASHING_SCHEME_VERSION_V4` Ledger API enum value and the matching `SubmitRequestValidator` case (required for `-Werror` match exhaustiveness once the enum exists)
- the daml-lf `transaction.proto` field for recorded results
- the regenerated protobuf snapshot and `openapi.yaml` (V4 enum), plus hash tests, generators and docs

## Out of scope

The prepared-transaction codec (PR 2), command-execution wiring (PR 3), engine replay (PR 4), the extension-service runtime (PR 5+), consistency checking, routing and validation (PR 6–8). No LF semantics change. The feature is `ProtocolVersion.dev`-gated, so this PR is dormant on released protocol versions.

## Hashing Boundary

Recorded external-call result payloads are Canton protocol data: after submission they are carried in `ViewParticipantData.externalCallResults` and protected by the Canton view signature. V4 hashing folds them into the Canton transaction hash on that basis. (Their exclusion from the LF/prepared node hash is covered in PR 2.)

## Stacking & review

PR 1 of an 8-PR series; it is the base, so its diff against `main` is already the clean per-PR change. The series is stacked, so PRs 2–8 should be reviewed/merged in order (each rebased onto `main` as the previous lands). Dependency notes are in each PR.

Refs digital-asset#513.
@angelol
angelol force-pushed the angelol/external-call-06-split-pr2-codec branch from b0eab55 to f52559e Compare July 1, 2026 19:18
canton-machine and others added 3 commits July 2, 2026 15:05
@angelol
angelol force-pushed the angelol/external-call-06-split-pr2-codec branch from f52559e to 8a3889f Compare July 3, 2026 05:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants